package common.Tables;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
/**
 * Client include clientId ,client name , and set of candidates 
 * (many to many relation with Candidate)
 * @author Orit 
 */

public class Client implements Table, Serializable{
	
	private static final long serialVersionUID = 1L;
	private long clientId;			 	//serial number of the arrangement
	private String clientName = "";	 
	private String clientNumber = "";	//number of the client 
	private Set<Candidate> candidates = new HashSet<Candidate>(0); //his candidates
	private Set<Job> jobs = new HashSet<Job>(0);				   //his jobs
	
	//-----------------setters && getters for Tag----------------//	
	/**
	 * get Client Id
	 * @return Client's id
	 */
	public long getClientId() {
		return clientId;
	}
	/**
	 * set Client Id
	 * @param clientId
	 */
	public void setClientId(long clientId) {
		this.clientId = clientId;
	}
	/**
	 * get client Name
	 * @return client's name
	 */
	public String getClientName() {
		return clientName;
	}
	/**
	 * set client Name
	 * @param clientName
	 */
	public void setClientName(String clientName) {
		this.clientName = clientName;
	}
	/**
	 * get Candidates list
	 * @return list of Candidates
	 */
	public Set<Candidate> getCandidates() {
		return candidates;
	}
	/**
	 * set Candidates list
	 * @param Candidates
	 */
	public void setCandidates(Set<Candidate> candidates) {
		this.candidates = candidates;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return clientName;
	}
	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		Client c = (Client) obj;
		return c.getClientName().equals(clientName);
	}
	public void setJobs(Set<Job> jobs) {
		this.jobs = jobs;
	}
	public Set<Job> getJobs() {
		return jobs;
	}
	public void setClientNumber(String clientNumber) {
		this.clientNumber = clientNumber;
	}
	public String getClientNumber() {
		return clientNumber;
	}
}
